<?php
/**
 *
 * @author Dang Thu Trang <trangdtdg@gmail.com>
 *
 */

class Model_setting extends Model {

    var $_tbl_name = "tbl_setting";

    function __construct($lang_code = null) {
        // Call the Model constructor
        parent::Model();
    }

    /**
     *
     *
     */
    function first_row(){
		$query = $this->db->get($this->_tbl_name);
        if ($query->num_rows() > 0) {
            return $query->first_row('array');
        }
	    return null;
    }

    /**
     *
     * @param object $id
     * @param object $data
     * @return
     */
    function update($id, $data) {
        if (intval($id)) {
            $this->db->where('id', $id);
        	$data['modifieddate'] = date("Y-m-d h:i:s");
            return $this->db->update($this->_tbl_name, $data);
        }
    }
}
?>
